﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;

namespace Matryoshka
{
    public class DecalManager
    {
        static List<Decal> listDecals = new List<Decal>();

        public DecalManager()
        {
        }

        public static void Add(Decal decal)
        {
            listDecals.Add(decal);
        }

        public static void Update(float dtime)
        {
            foreach(Decal decal in listDecals)
            {
                decal.Update(dtime);
            }

            listDecals.RemoveAll(decal => decal.done);
        }

        public static void Draw(SpriteBatch spriteBatch)
        {
            foreach(Decal decal in listDecals)
            {
                decal.Draw(spriteBatch);
            }
        }
    }
}
